var arr = [1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3]

// 1.Set
/* var set = new Set(arr)
console.log(Array.from(set));
console.log([...set]); */

// 2.指针
/* for (let i = 0; i < arr.length; i++) {
    for (let j = i + 1; j < arr.length; j++) {
        if (arr[i] == arr[j]) {
            arr.splice(j,1)
            j--
        }
    }
}
console.log(arr); */

// 3.indexOf
/* var newArr=[]
for (let i = 0; i < arr.length; i++) {
    if (newArr.indexOf(arr[i])==-1) {
        newArr.push(arr[i])
    }
}
console.log(newArr); */

// 4.includes
/* var newArr=[]
for (let i = 0; i < arr.length; i++) {
    if (!newArr.includes(arr[i])) {
        newArr.push(arr[i])
    }
}
console.log(newArr); */

// 5.filter
/* var newArr=arr.filter((item,index)=>{
    return arr.indexOf(item)==index
})
console.log(newArr); */